package com.learning.assignment_1;

import com.learning.downloader.ImageDownloader;

import android.app.Activity;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;

public class WatchVideo extends Activity{
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.watchvideo);
		VideoView videoView = (VideoView) findViewById(R.id.videoView);
		MediaController mediacontroller = new MediaController(this);
		mediacontroller.setAnchorView(videoView);
		
		String urlVideo = "http://stream2.nixcdn.com/925c95b4f2d71af15a1f84f51d953c52/52833479/PreNCT3/CoKhiNaoRoiXa-BuiBichPhuong_as6.mp4";
		Uri video = Uri.parse(urlVideo);
		videoView.setVideoURI(video);
		videoView.setMediaController(mediacontroller);
		videoView.start();						
		ImageDownloader mDownloader = new ImageDownloader(urlVideo,this);
		
		/*--- we need to call execute() since nothing will happen otherwise ---*/
		mDownloader.execute();
	}
	
}
